<template>
  <div class="loading">
    <div class="loading-spinner"></div>
    <span>正在加载地震数据...</span>
  </div>
</template>

<script>
export default {
  name: 'LoadingSpinner'
}
</script>

<style scoped>
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 2000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #4299e1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading span {
    font-weight: 500;
    color: #4a5568;
}
</style>
</template>
</write_to_file>

<write_to_file>
<path>earthquake-monitor-v2/src/components/ControlPanel.vue</path>
<content>
<template>
  <div class="controls">
    <button class="control-btn" @click="$emit('refresh')">
      <span class="btn-icon">🔄</span>
      刷新数据
    </button>
    <button 
      class="control-btn" 
      :class="{ active: isAutoRefresh }"
      @click="$emit('toggleAutoRefresh')"
    >
      <span class="btn-icon">⏰</span>
      自动刷新: {{ isAutoRefresh ? '开启' : '关闭' }}
    </button>
    <select 
      class="control-select" 
      :value="currentFilter"
      @change="$emit('filterChange', $event.target.value)"
    >
      <option value="all">所有震级</option>
      <option value="significant">显著地震 (4.5+)</option>
      <option value="major">重大地震 (6.0+)</option>
    </select>
  </div>
</template>

<script>
export default {
  name: 'ControlPanel',
  props: {
    isAutoRefresh: {
      type: Boolean,
      default: false
    },
    currentFilter: {
      type: String,
      default: 'all'
    }
  },
  emits: ['refresh', 'toggleAutoRefresh', 'filterChange']
}
</script>

<style scoped>
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    flex-wrap: wrap;
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #4299e1, #3182ce);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(66, 153, 225, 0.3);
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(66, 153, 225, 0.4);
}

.control-btn:active {
    transform: translateY(0);
}

.control-btn.active {
    background: linear-gradient(135deg, #48bb78, #38a169);
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.3);
}

.control-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

@media (max-width: 768px) {
    .controls {
        padding: 1rem;
        gap: 0.5rem;
    }
    
    .control-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .controls {
        flex-direction: column;
    }
}
</style>
</template>
</write_to_file>

<execute_command>
<command>cd earthquake-monitor-v2 && npm install</command>
<requires_approval>false</requires_approval>
</execute_command>